home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1328 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.5 KB  |  58 lines

  1. Newsgroups: comp.lang.c
  2. Path: uu4news.netcom.com!zodiac!szh
  3. From: szh@zcon.com (Syed Zaeem Hosain)
  4. Subject: Re: What is wrong in this code?
  5. Message-ID: <1996Jan13.000841.20965@zcon.com>
  6. Sender: szh@zcon.com (Syed Zaeem Hosain)
  7. Nntp-Posting-Host: zodiac
  8. Reply-To: szh@zcon.com
  9. Organization: Z Consulting Group
  10. References: <DL2z7o.2K5@scisun.sci.ccny.cuny.edu>
  11. Date: Sat, 13 Jan 1996 00:08:41 GMT
  12.  
  13. In article <DL2z7o.2K5@scisun.sci.ccny.cuny.edu>, sergio@sci.ccny.cuny.edu (Sergio Rojas) writes:
  14. >  I am traying to be literate in C and here is a
  15. >problem wich I have been unable to detect:
  16. >
  17. >#include <stdio.h>
  18. >#include <math.h>
  19. >main()
  20. >{
  21. >double x;
  22. >
  23. >printf("\n Enter a number \n");
  24. >
  25. >scanf("%f", &x);
  26. >
  27. >printf("\n %e to the power %e is equal to   ", x , x );
  28. >
  29. >x = pow(x,x); 
  30. >
  31. >printf(" %12.6f \n", x );
  32. >
  33. >}
  34.  
  35.  
  36. Your question is clearly answered in the FAQ for this newsgroup. Please
  37. get it from rtfm.mit.edu:/pub/usenet/... and look at the question 12.13
  38. and its answer. For reference, here is the question:
  39.  
  40. 12.13:  Why doesn't this code:
  41.  
  42.                 double d;
  43.                 scanf("%f", &d);
  44.  
  45.         work?
  46.  
  47. A:     [deleted ... to make you go get the FAQ and read it]
  48.  
  49.  
  50.                                 Z
  51.  
  52.  
  53. -- 
  54. -------------------------------------------------------------------------
  55. | Syed Zaeem Hosain          P. O. Box 610097            (408) 441-7021 |
  56. | Z Consulting Group        San Jose, CA 95161             szh@zcon.com |
  57. -------------------------------------------------------------------------
  58.